package unclassified.ccb;

import java.util.*;

/**
 * 地铁路线规划
 */
public class MetroLinePlanning {

//    public int[] metroRouteDesignI(int[][] lines, int start, int end) {
//
//        Map<Integer, List<Cell>> map = new HashMap<>();
//        for (int[] line : lines) {
//            for (int i = 0; i < line.length - 1; i++) {
//                List<Cell> c1 = map.computeIfAbsent(line[i], k -> new ArrayList<>());
//                if (c1.size() == 0) {
//                    c1.add(new Cell(line[i + 1], 1));
//                } else {
//                    c1.add(new Cell(line[i + 1], c1.size() + 1));
//                }
//                List<Cell> c2 = map.computeIfAbsent(line[i + 1], k -> new ArrayList<>());
//                if (c2.size() == 0) {
//                    c2.add(new Cell(line[i + 1], 1));
//                } else {
//                    c2.add(new Cell(line[i + 1], c2.size() + 1));
//                }
//            }
//        }
//        //最大堆
//        PriorityQueue<Cell> queue = new PriorityQueue<>();
//        //去重
//        Map<Integer, Integer> visited = new LinkedHashMap<>();
//
//        while(!queue.isEmpty()) {
//
//        }
//
//    }

    class Cell implements Comparable<Cell> {
        int node, edge;

        Cell(int node, int edge){
            this.node = node;
            this.edge = edge;
        }
        @Override
        public int compareTo(Cell o) {
            return  o.edge - this.edge;
        }
    }

}
